<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="../css/common.css" />
<script src="../js/common/jquery.js"></script>
<script src="../js/common/drag.js"></script>
<script src="../js/common/angular.min.js"></script>
<script type="text/javascript" src="../js/common/common.js"></script>
<script type="text/javascript" src="../js/form.js"></script>
</head>
<body ng-app="myApp">

<div class="dqwz">
    <span>当前位置：</span>
    <span>AngularJS 表单</span>
</div>

<section>
    <div ng-controller="formCtrl">
        <h3>【AngularJS 表单实例】</h3>
        <form novalidate>
            <p><input type="text" name="" ng-model="user.fname"></p>
            <p><input type="text" name="" ng-model="user.lname"></p>
            <p><button type="button" ng-click="reset()">还原</button></p>
            user:{{user}};
            default:{{default}};
        </form>
        <!-- 查看源码开始 -->
        <div class="htmlCode">
            <span>【html源码】</span>
            <xmp ng-non-bindable>
<form novalidate>
    <p><input type="text" name="" ng-model="user.fname"></p>
    <p><input type="text" name="" ng-model="user.lname"></p>
    <p><button type="button" ng-click="reset()">还原</button></p>
    user:{{user}};
    default:{{default}};
</form>
            </xmp>
            <span>【js源码】</span>
            <xmp>
app.controller('formCtrl',function($scope){
    $scope.default = {
        'fname':'张',
        'lname':'三'
    }
    $scope.reset = function(){
        $scope.user = angular.copy($scope.default);//复制一个对象
    }
    $scope.reset();
})
            </xmp>
            <span class="close"><a href="javascript:;">关闭</a></span>
        </div>
        <div class="viewCode">
            <span><a href="javascript:;"> >>查看源码</a></span>
        </div>
        <!-- 查看源码结束 -->
    </div>
</section>

<div class="mask_layer">
</div>

</body>
</html>